<?php 
$email = array(
	"name"		=> "email",
	"id"		=> "email",
	"value"		=> set_value("email", $login_user->email),
	'class'		=> 'text-input medium-input'
);

$change_password = array(
    'name'        => 'change_password',
    'id'          => 'change_password',
    'value'       => 'change',
    'checked'     => set_value("change_password")!=""?TRUE:FALSE
);
?>

<script type="text/javascript">
	$(document).ready(function(){
		$("#change_password").click(check_change_password_display);

		function check_change_password_display(){
			if($("#change_password").is(":checked")){
				$(".change_password_field").show();
			} else{
				$(".change_password_field").hide();
			}
		}
		check_change_password_display();
	});	
</script>



<div class="content-box"><!-- Start Content Box -->
				
	<div class="content-box-header">
		
		<h3>Editar el perfil del Usuario</h3>
				
		<div class="clear"></div>
		
	</div> <!-- End .content-box-header -->
	
	<div class="content-box-content">
					
	<?php echo form_open($this->uri->uri_string()); ?>
		
		<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
			<p>
				<label>Email</label>
				<?php echo form_input($email); ?>
			</p>
			
			<p>
				<label>Cambiar Contraseña</label>
				<?php echo form_checkbox($change_password); ?> ¿Desea cambiar la contraseña?
			</p>
			
			<p class="change_password_field">
				<label>Contraseña</label>
				<?php echo form_password('password', '', 'class="text-input medium-input"'); ?>
			</p>
			<p class="change_password_field">
				<label>Confirmación de contraseña</label>
				<?php echo form_password('passconf', '', 'class="text-input medium-input"'); ?>
			</p>
			
			<?php foreach($additional_columns as $column):?>
	    	<p>
				<label><?php echo $column; ?></label>
				<?php echo form_input($column, set_value($column, $login_user->{$column}), 'class="text-input medium-input"'); ?>
			</p>
			<?php endforeach;?>
			
			<p class="align-right">
				<input class="button" type="submit" value="Editar Perfil" />
			</p>
			
		</fieldset>
	
	<?php echo form_close(); ?>
	</div>
		
</div>